package dataStructure;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ASUS
 * Date: 2025-05-02
 * Time: 19:29
 */
public class RotationArray {
   public static int[] nums = new int[7];
    public static void main(String[] args) {

        class Solution {
            public void rotate(int[] nums, int k) {
                int n = nums.length;
                int[] newArr = new int[n];
                for (int i = 0; i < n; i++) {
                    newArr[(i + k) % n] = nums[i];
                }
                System.arraycopy(newArr, 0, nums, 0, n);
            }
        }
        Solution solution = new Solution();

        solution.rotate(nums,3);
    }
}
